home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / maximus / stbar110.zip / STARBAR.MEX < prev    next >
Text File  |  1996-02-13  |  22KB  |  633 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // StarBar File Selector V1.10 (!)1996 Larry Monte/StarLab Systems
  4. //
  5. // MEX: Copyright 1990, 1995 by Lanius Corporation.  All rights reserved.
  6. //
  7. // Thanks to everyone who helped test StarBar in the early stages! Your
  8. // help was most appreciated. I regret that it isn't more OS/2
  9. // compatible, but without an OS/2 machine, it's pretty hard.
  10. //
  11. // Thanks to Frank Van Uffelen for his help in implementing GUS and ACLE
  12. // for extracting archive files.
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15.  
  16.  
  17. #include <max.mh>
  18. #include <longpad.mh>
  19. #define MAX_LINES    24
  20. #define DESCRIPT     48
  21.  
  22. ////////////////-=These defines must be changed by you!=-//////////////////
  23.  
  24. // The following 4 defines should be changed to reflect your setup
  25.  
  26. #define ACCESS       ">= Limited "     //Change to access preferred.
  27.                                        //Be sure to include a space
  28.                                        //at the end: "= Sysop "
  29.                                        //                    ^
  30.  
  31. #define STARBAR_PATH "c:\\max\\starbar\\"   //Change to where you put your
  32.                                             //StarBar files.
  33.                                             //EG: "C:\\MAX\\M\\"
  34.                                             //EG: "E:\\BBS\\MAX\\M\\"
  35.  
  36. // Define how many characters you would like to use in your DL counter.
  37. // I suggest using _at least_ 2 places ("[ 9]") so that the DL counter is
  38. // good up to 99. If you have a file that has been DL'ed more than 99
  39. // times then three spaces is a good idea. I use 4 places here ("[   9]")
  40. // giving me upward compatability up to 9999 DL's on any given file.
  41. // If you don't want to use a DL counter, define zero.
  42.  
  43. #define OFFSET   4
  44.  
  45. // The KEY define works with STTOG. With STTOG in your file menu, users
  46. // can select if they want to use STARBAR or the canned file listing.
  47. // This can be set to any valid access key used by Maximus. Be sure
  48. // to select a key not being used by anything else.
  49.  
  50. #define KEY     "O"
  51.  
  52. // The DEFAULT_PATH sets where files download by LOCAL users (sysop) will
  53. // end up on their Hard Drive. You will also be prompted before the
  54. // download if you want to specify an alternative path or hit <ENTER> to
  55. // use the path set here
  56. // Don't forget to use double \\'s and include the trailing backslashes!
  57.  
  58. #define DEFAULT_PATH  "C:\\ATEMP\\"
  59.  
  60. ////////////////////////////////////////////////////////////////////////////
  61.  
  62. #define this_task uitostr(id.task_num)
  63.  
  64. #define FF_OFFLINE     0x02
  65. #define FF_STAGEPATH   prm_string(3)+prm_string(128)
  66.  
  67. char: nonstop;
  68. struct _ffind: ff;
  69.  
  70. struct _filesbbs
  71. {
  72.  string : fname;
  73.  string : size;
  74.  string : date;
  75.  string : description;
  76. };
  77.  
  78. void bit_date_to_stamp(unsigned long: ulong, ref struct _stamp: udate)
  79. {
  80.   udate.time.hh    := (ulong & 0xf8000000) shr 27;
  81.   udate.time.mm    := (ulong & 0x07e00000) shr 21;
  82.   udate.time.ss    := (ulong & 0x001f0000) shr 15;
  83.   udate.date.year  := (ulong & 0xfe00) shr 9;
  84.   udate.date.month := (ulong & 0x01e0) shr 5;
  85.   udate.date.day   := (ulong & 0x001f);
  86. }
  87.  
  88. unsigned long hextoul(string: strinp, int: ofst)
  89. {
  90.   unsigned long: wlong;
  91.  
  92.   wlong := (unsigned char)strinp[ofst+3];
  93.   wlong := (wlong shl 8) + (unsigned char)strinp[ofst+2];
  94.   wlong := (wlong shl 8) + (unsigned char)strinp[ofst+1];
  95.   return (wlong shl 8) + (unsigned char)strinp[ofst];
  96. }
  97.  
  98. unsigned int hextoui(string: strinp, int: ofst)
  99. {
  100.   unsigned int: wint;
  101.  
  102.   wint := (unsigned char)strinp[ofst+1];
  103.   return (wint shl 8) + (unsigned char)strinp[ofst];
  104. }
  105.  
  106. int fopen(ref int: idx_handle,ref int: dmp_handle,ref int: dat_handle,ref long: idx_file_size,ref long: dat_file_size)
  107. {
  108.   string: files_bbs_path;
  109.   if (farea.filesbbs > "") 
  110.     files_bbs_path := substr(farea.filesbbs,1,strridx(farea.filesbbs,0,'.')-1);
  111.   else files_bbs_path := farea.downpath + "files";
  112.   idx_handle := open(files_bbs_path + ".idx", IOPEN_READ|IOPEN_BINARY);
  113.   if (idx_handle < 0) return(idx_handle);
  114.   idx_file_size := filesize(files_bbs_path + ".idx")/16;
  115.   dmp_handle := open(files_bbs_path + ".dmp", IOPEN_READ|IOPEN_BINARY);
  116.   if (dmp_handle < 0) return(dmp_handle);
  117.   dat_file_size := filesize(files_bbs_path + ".dat");
  118.   dat_handle := open(files_bbs_path + ".dat", IOPEN_READ|IOPEN_BINARY);
  119.   if (dat_handle < 0) return(dat_handle);
  120.   else return(0);
  121. }
  122.  
  123. void cleanup()
  124. {
  125.   remove(STARBAR_PATH+"descfile."+this_task);
  126.   if (filefindfirst(ff,STARBAR_PATH+"temp"+this_task+"\\*.*", FA_NORMAL))
  127.   {
  128.     do
  129.     {
  130.       remove(STARBAR_PATH+"temp"+this_task+"\\"+ff.filename);
  131.     }
  132.     while(filefindnext(ff));
  133.     filefindclose(ff);
  134.   }
  135.  
  136. }
  137.  
  138. // Extract and view FILE_ID.DIZ.
  139.  
  140. void get_desc(string: sourcefile)
  141. {
  142.   int: in;
  143.   int: z;
  144.   char: a;
  145.   array [1..100] of string: arc_fname;
  146.  
  147.   shell(IOUTSIDE_DOS|IOUTSIDE_REREAD, STARBAR_PATH+"starhlp.bat "+ STARBAR_PATH + " " + sourcefile + " " + this_task);
  148.   display_file(STARBAR_PATH+"descfile."+this_task, nonstop);
  149.   in := (input_list("NY",0,"","","\n\n\x16\x01\x0eExamine The Archive For DOC or TEXT files? : "));
  150.   if (in = 'y' OR in = 'Y')
  151.   {
  152.     print("\x0cHang On, This May Take A Few Seconds....");
  153.     shell(IOUTSIDE_DOS|IOUTSIDE_REREAD, STARBAR_PATH+"content.bat "+ STARBAR_PATH + " " + sourcefile + " " + this_task);
  154. again:
  155.     z:=0;
  156.     a:='@';
  157.     print("\x0cLetter  FileName       FileSize\n────────────────────────────────────\n");
  158.     if (filefindfirst(ff,STARBAR_PATH+"temp"+this_task+"\\*.*", FA_NORMAL))
  159.     {
  160.       do
  161.       {
  162.         if (strfind(ff.filename,".DOC") OR strfind(ff.filename,".TXT") OR strfind(ff.filename,".PRN") OR (strfind(ff.filename,"READ") AND strfind(ff.filename,"ME")))
  163.         {
  164.           a:=a+1;
  165.           z:=z+1;
  166.           arc_fname[z]:=ff.filename;
  167.           print("\x16\x01\x09", a, "   - \x16\x01\x0e  "+strpad(arc_fname[z],14,' ')+"\x16\x01\x02"+longpadleft(ff.filesize,9,' ')+"\n");
  168.         }
  169.       }
  170.       while (filefindnext(ff));
  171.       filefindclose(ff);
  172.     }
  173.     if (z = 0)
  174.       print("\n\x16\x01\x0eArchive Contains No Identified DOC or TEXT Files..\n\n");
  175.     print("\x16\x01\x0fSee contents of which file? (Enter Letter, or 0 To Exit): ");
  176.     in := (input_list("0ABCDEFGHIJKLMNOPQRSTUVWXYZ",CINPUT_FULLPROMPT,"","","")-64);
  177.     if (in <> -16)
  178.     {
  179.       print("\x0c");
  180.       display_file(STARBAR_PATH+"temp"+this_task+"\\"+arc_fname[in], nonstop);
  181.       in := (input_list("YN",0,"","","Look at another file?"));
  182.       if (in = 'y' OR in = 'Y')
  183.       {
  184.         goto again;
  185.       }
  186.       print("\n");
  187.     }
  188.   }
  189.   cleanup();
  190. }
  191.  
  192. // LowLight Filename.
  193.  
  194. void lolite(struct _filesbbs: filesbbs, int: count)
  195. {
  196.  print(AVATAR_GOTO,(char)(count),(char)1);
  197.  print("\x16\x01\x0e"+strpad(filesbbs.fname,14,' '));
  198.  print("\x16\x01\x05"+filesbbs.size);
  199.  print(" \x16\x01\x02"+filesbbs.date+" ");
  200. }
  201.  
  202. // HighLight filename
  203.  
  204. void hilite(struct _filesbbs: filesbbs, int: count)
  205. {
  206.  print(AVATAR_GOTO,(char)(count),(char)1);
  207.  print("\x16\x01\x70"+strpad(filesbbs.fname,14,' '));
  208.  print("\x16\x01\x71"+filesbbs.size);
  209.  print(" \x16\x01\x78"+filesbbs.date+" ");
  210. }
  211.  
  212. // Print area description and commands at bottom of screen.
  213.  
  214. void print_footer()
  215. {
  216.  string: line, area;
  217.  
  218.  area := "\x16\x01\x07<\x16\x01\x0e"+farea.name+"\x16\x01\x07>\x16\x01\x0b "+farea.descript+"\x16\x01\x09";
  219.  line := strpad(area,86,'─');
  220.  print("\x16\x08", (char)(MAX_LINES-3), (char)1, "\x16\x01\x01──\x16\x01\x09"+"Area: "+ substr(line,1,86)+ "\n");
  221.  print("\x16\x01\x0f[\x16\x01\x0e8\x16\x01\x0f]\x16\x01\x02Up \x16\x01\x0f [\x16\x01\x0e9\x16\x01\x0f]\x16\x01\x02PgUp \x16\x01\x0f [\x16\x01\x0eSPACE\x16\x01\x0f]\x16\x01\x02Tag/UnTag Files\x16\x01\x0f [\x16\x01\x0eENTER\x16\x01\x0f]\x16\x01\x02D/L Current \x16\x01\x0f[\x16\x01\x0eD\x16\x01\x0f]\x16\x01\x02D/L Tagged File(s)\n");
  222.  print("\x16\x01\x0f[\x16\x01\x0e2\x16\x01\x0f]\x16\x01\x02Dn \x16\x01\x0f [\x16\x01\x0e3\x16\x01\x0f]\x16\x01\x02PgDn \x16\x01\x0f [\x16\x01\x0eV\x16\x01\x0f]\x16\x01\x02View Long Description\x16\x01\x0f [\x16\x01\x0eL\x16\x01\x0f]\x16\x01\x02List Tagged Files\x16\x01\x0f  [\x16\x01\x0e\x16\x02X\x16\x01\x0f]\x16\x01\x02Exit\x16\x01\x0f  [\x16\x01\x0c?\x16\x01\x0f]\x16\x01\x0eHelp\n");
  223.  print("\x16\x01\x1e   StarBar! LightBar File Selector V1.10 (!)1996 Larry Monte/StarLab Systems   ");
  224. }
  225.  
  226. // Read FILES.DAT/IDX/DMP for info...
  227.  
  228. void read_fbbs(string:dpath)
  229. {
  230.  array [1..255] of long : page; // maximum 255 pages (Big enough?) >:-)
  231.  array [1..MAX_LINES] of struct _filesbbs : filesbbs;
  232.  int: brackets,return_code, ch, pos, checkdl;
  233.  int: current_file_dat_rec,count,i,ok,pageno,arch;
  234.  int: continue,idx_handle, dat_handle, dmp_handle;
  235.  long:  dat_rec_size,dat_file_size,idx_file_size,posn;
  236.  unsigned long: dmp_descr_length;
  237.  char: ff_flags;
  238.  string: dat_rec,desc_line1,desc_line2;
  239.  string: counter,tempdmp,temp_desc_line1;
  240.  struct _ffind: ff;
  241.  struct _stamp:upld_date;
  242.  
  243.  
  244.  pageno := 1;
  245.  page[pageno] := 0;
  246.  if (fopen(idx_handle,dmp_handle,dat_handle,idx_file_size,dat_file_size))
  247.  {
  248.    menu_cmd(502,"");
  249.    return;
  250.  }
  251.  else
  252.  {
  253.    current_file_dat_rec := 0;
  254.    return_code := read(dat_handle,dat_rec,32);
  255.    dat_rec_size := dat_rec[14];
  256.    seek(dat_handle,0,SEEK_SET);
  257. top:
  258.    posn:=0;
  259.    continue := True;
  260.    count := 1;
  261.  
  262.    for (i:=1;i<MAX_LINES;i:=i+1)                   // Clear everything
  263.    {                                               // just in case.
  264.      filesbbs[i].fname:= "";
  265.      filesbbs[i].size := "";
  266.      filesbbs[i].date := "";
  267.      filesbbs[i].description := "";
  268.    }
  269.    print("\x0c");
  270.    while (count < (MAX_LINES-5) AND continue = True )
  271.    {
  272.      page[pageno+1] := seek(dat_handle, page[pageno]+posn,SEEK_SET);
  273.      return_code := read(dat_handle,dat_rec,dat_rec_size);
  274.      posn := posn+dat_rec_size;
  275.      if (return_code = 0)
  276.      {
  277.        continue := False;
  278.        goto out;
  279.      }
  280.      filesbbs[count].fname := substr(dat_rec,1,stridx(dat_rec,1,0x00)-1);
  281.      ff_flags := dat_rec[15];
  282.      if (ff_flags & FF_OFFLINE)
  283.      {
  284.        filesbbs[count].size := "<File OffLine>  ";
  285.        filesbbs[count].date := "";
  286.      }
  287.      else
  288.      {
  289.        filesbbs[count].size := strpadleft(ultostr(hextoul(dat_rec,35)),7,' ');
  290.        bit_date_to_stamp(hextoul(dat_rec,27),upld_date);
  291.        filesbbs[count].date := substr(stamp_string(upld_date),1,9);
  292.      }
  293.      seek(dmp_handle,hextoul(dat_rec,43),SEEK_SET);
  294.      read(dmp_handle,tempdmp,2);
  295.      dmp_descr_length := hextoui(tempdmp,1);
  296.      read(dmp_handle,tempdmp,dmp_descr_length);
  297.      if (OFFSET > 0)
  298.      {
  299.        counter := "[" + strpadleft(ltostr(hextoul(dat_rec,23)),OFFSET,' ') + "] ";
  300.        brackets := 3;
  301.      }
  302.      filesbbs[count].description := counter+tempdmp;
  303.      current_file_dat_rec := current_file_dat_rec +1;
  304.      lolite(filesbbs[count],count);
  305.      pos :=1;
  306.      if (strlen(filesbbs[count].description) > DESCRIPT)
  307.      {
  308.        temp_desc_line1 := substr(filesbbs[count].description, 1, DESCRIPT);
  309.        for (i:=DESCRIPT; i > 0; i:=i-1)
  310.        {                                               // WordWrap
  311.          if (temp_desc_line1[i] = ' ')                 // routine.
  312.          {
  313.            desc_line1 := substr(filesbbs[count].description, pos, i-1);
  314.            desc_line2 := substr(filesbbs[count].description, i+1, 80);
  315.            print("\x16\x01\x03"+desc_line1);
  316.            if (count < MAX_LINES-6)
  317.            {
  318.              print("\n\x16\x01\x03"+strpad(" ", 32+OFFSET+brackets, ' '));
  319.              print("\x16\x01\x03"+substr(desc_line2,1,DESCRIPT-(OFFSET+brackets)));
  320.              count := count + 1;
  321.              i := 0;
  322.              goto out;
  323.            }
  324.            count := count +1;
  325.            goto out;
  326.          }
  327.        }
  328.      }
  329.      print("\x16\x01\x03"+filesbbs[count].description);
  330. out:
  331.      count := count + 1;
  332.    } // end while readln
  333.  
  334.    pageno := pageno + 1;
  335.    if (page[pageno] >= dat_file_size)
  336.      print("\x16\x01\x0f\n                           -=End Of File List=-");
  337.    while(count < MAX_LINES-7 )
  338.    {
  339.      print("\n");
  340.      count := count + 1;
  341.    }
  342.    print_footer();
  343.    count := 1;
  344.    hilite(filesbbs[count],count);
  345.  
  346.    ok := 0;
  347.    while (ok =0)
  348.    {
  349.      print("\x16\x08",(char)(MAX_LINES-5),(char)50, "\x16\x01\x10\x80");
  350.      ch := input_ch(CINPUT_NOLF | CINPUT_SCAN,"");
  351.      if (ch = 'X' OR ch = 'x')                       // Exit StarBar.
  352.      {
  353.        print("\x0c");
  354.        ok := 1;
  355.      }
  356.      if (ch = '?')                                   // Help File.
  357.      {
  358.        nonstop := 0;
  359.        display_file(STARBAR_PATH+"sbhelp.bbs", nonstop);
  360.        count := 1;
  361.        pageno := pageno -1;
  362.        goto top;
  363.      }
  364.      if ((ch = '2' OR ch = 20480) AND (count < (MAX_LINES-5)))   // Move Down
  365.      {
  366.        lolite(filesbbs[count],count);
  367.        count := count + 1;
  368.        while(filesbbs[count].fname = "" AND MAX_LINES-5 > count)
  369.          count := count +1;
  370.        if (MAX_LINES-5 = count)
  371.        {
  372.          if (page[pageno] = dat_file_size)
  373.          {
  374.            count := 1;
  375.            pageno := pageno -1;
  376.          }
  377.          goto top;
  378.        }
  379.        if (filesbbs[count].fname = "")
  380.        {
  381.          count := count - 1;
  382.          hilite(filesbbs[count],count);
  383.        }
  384.        else
  385.          hilite(filesbbs[count],count);
  386.      }
  387.      if ((ch = '8' OR ch = 18432) AND pageno > 1)               // Move Up
  388.      {
  389.        if (count <= 1 AND pageno > 2)
  390.        {
  391.          count := 1;
  392.          pageno := pageno -2;
  393.          goto top;
  394.        }
  395.        if (pageno >= 2 AND count > 1)
  396.        {
  397.        print("\x16\x08",(char)(count+1),(char)1);
  398.        lolite(filesbbs[count],count);
  399.        count := count -1;
  400.        while((strlen(filesbbs[count].fname) = 0))
  401.          count := count-1;
  402.        if (count <= 1)
  403.          count := 1;
  404.        print("\x16\x08",(char)(count+1),(char)1);
  405.        hilite(filesbbs[count],count);
  406.        }
  407.      }
  408.      if ((ch = '3' OR ch = 20736) AND (page[pageno] < dat_file_size)) // Page Down
  409.        goto top;
  410.  
  411.      if ((ch = '9' OR ch = 18688) AND (pageno > 2))              // page up
  412.      {
  413.        pageno := pageno - 2;
  414.        goto top;
  415.      }
  416.      if (ch = 'L' OR ch = 'l')                         // List Tagged Files
  417.      {
  418.        if (privok(ACCESS) = FALSE)
  419.        {
  420.          print("\x0c\x16\x01\x0cSorry, you don't have access to this Function!\n\n");
  421.          menu_cmd(106,"");
  422.          pageno := pageno -1;
  423.          goto top;
  424.        }
  425.        input := "L;";
  426.        print("\x0c");
  427.        menu_cmd(512,"");
  428.        count := 1;
  429.        pageno := pageno -1;
  430.        goto top;
  431.      }
  432.      if (ch = ' ' OR ch = 'T' OR ch = 't')             // Tag File
  433.      {
  434.        int: que, quelim, flags, pos, times;
  435.        string: filescheck, rootname;
  436.  
  437.        if (privok(ACCESS) = FALSE)
  438.        {
  439.          print("\x0c\x16\x01\x0cSorry, you don't have access to this Function!\n\n");
  440.          menu_cmd(106,"");
  441.          pageno := pageno -1;
  442.          goto top;
  443.        }
  444.        que := (tag_queue_size()-1);
  445.        quelim := que;
  446.        if (que >= 0)
  447.        {
  448.          for (times:=que+2; que >= 0; times:=times-1)
  449.          {
  450.            tag_get_name( que, flags, filescheck );
  451.            pos := strridx(filescheck, 0, '\\');
  452.            rootname := substr(filescheck,pos+1,12);
  453.            if (rootname = filesbbs[count].fname)
  454.            {
  455.              tag_dequeue_file(que);
  456.              print("\x16\x08",(char)(MAX_LINES-5),(char)1, "\x16\x01\x10\x80\x16\x07");
  457.              print("\x16\x08",(char)(MAX_LINES-5),(char)1, "\x16\x01\x0f"+filesbbs[count].fname+"\x16\x01\x07 Removed From Tag List!");
  458.              goto done;
  459.            }
  460.            que := que -1;
  461.          }
  462.        }
  463.       if (quelim >=30)
  464.       {
  465.         print("\x0c\x16\x01\x0cSorry, only 31 tagged files allowed at once!\n\n");
  466.         menu_cmd(106,"");
  467.         pageno := pageno -1;
  468.         goto top;
  469.       }
  470.       input := "A;"+filesbbs[count].fname;
  471.       print("\x16\x08",(char)(MAX_LINES-5),(char)1, "\x16\x01\x10\x80\x16\x07");
  472.       print("\x16\x08",(char)(MAX_LINES-6),(char)5);
  473.       menu_cmd(512,"");
  474.      }
  475.  
  476. done:
  477.  
  478.      if (ch = 'V' OR ch = 'v')             // View File_Id.Diz From Archive
  479.      {
  480.        print("\x0c\x16\x01\x0eHold on...Getting Description!\n");
  481.        print("\x16\x01\x02Be patient...some files will take a bit longer...\n\n\x16\x01\x03");
  482.        if (farea.attribs & FA_STAGED)
  483.        {
  484.          filecopy(farea.downpath + filesbbs[count].fname, FF_STAGEPATH + filesbbs[count].fname);
  485.          get_desc(FF_STAGEPATH + filesbbs[count].fname);
  486.          remove(FF_STAGEPATH+filesbbs[count].fname);
  487.        }
  488.        else
  489.        {
  490.        get_desc(farea.downpath + filesbbs[count].fname); // fvu 14/11/95 00:26
  491.        }
  492.        if (pageno > 1)
  493.          pageno := pageno -1;
  494.        goto top;
  495.      }
  496.      if (ch = 'D' OR ch = 'd' OR ch = '|')                // Download File
  497.      {
  498.        int: fnum, flags, pos, qsize;
  499.        long: fsize, txtime;
  500.        string: rootname, filescheck;
  501.  
  502.        if (privok(ACCESS) = FALSE)
  503.        {
  504.          print("\x0c\x16\x01\x0cSorry, you don't have access to this Function!\n\n");
  505.          menu_cmd(106,"");
  506.          pageno := pageno -1;
  507.          goto top;
  508.        }
  509.        print("\x0c");
  510.        if (ch = '|')
  511.        {
  512.          print("\x16\x01\x0fYou hit <ENTER> on file \x16\x01\x0e"+filesbbs[count].fname+"\n");
  513.          print("\x16\x01\x0fInclude this file for download?");
  514.          checkdl := input_list("|NY", 0, "", "", "");
  515.          if (checkdl = 'Y')
  516.          {
  517.            input := "A;"+filesbbs[count].fname;
  518.            menu_cmd(512,"");
  519.          }
  520.          if (checkdl = 'N' OR checkdl = '|' AND tag_queue_size()<=0)
  521.          {
  522.            print("\x0c");
  523.            goto stop;
  524.          }
  525.        }
  526.        print("\x16\x01\x0e\nTo Continue with transfer, Hit: \x16\x01\x02ENTER\n\n");
  527.        print("\x16\x01\x0eTo Cancel transfer, enter: \x16\x01\x02/q\n\n");
  528.        print("\x16\x01\x0eTo Edit the following tagged files, enter: \x16\x01\x02/e\n\n");
  529.        qsize := (tag_queue_size());
  530.        for (fnum := 0; fnum < qsize AND do_more(nonstop, COL_CYAN); fnum := fnum + 1)
  531.        {
  532.          tag_get_name( fnum, flags, filescheck);
  533.          pos := strridx(filescheck, 0, '\\');
  534.          if (pos=0)
  535.            rootname := filescheck;
  536.          else
  537.            rootname := substr(filescheck, pos+1, strlen(filescheck)-pos+1);
  538.          fsize := filesize(filescheck);
  539.          txtime := xfertime(PROTOCOL_ZMODEM, fsize);
  540.          print("\x16\x01\x0e(", fnum+1, ") \x16\x01\x0d"+strpad(rootname,16,' '), ' ', "\x16\x01\x0a(", strpadleft(ltostr(txtime/60),2,'0')+":"+strpadleft(ltostr(txtime%60),2,'0')+", "+strpadleft(ltostr(fsize),7,' ')+" Bytes)\n");
  541.        }
  542.        nonstop := 0;reset_more(nonstop);
  543.        if (id.local = TRUE)
  544.        {
  545.          string: added_filename, new_path, out_path;
  546.          while (ok = 0)
  547.          {
  548.            qsize := (tag_queue_size());
  549.            print("\x16\x01\x0f\nFile(s) To DownLoad(#",qsize+1,"): ");
  550.            input_str(added_filename, INPUT_WORD,0,14,"");
  551.            if (added_filename <> "" AND added_filename <> "/q")
  552.            {
  553.              input := "A;"+added_filename;
  554.              menu_cmd(512,"");
  555.            }
  556.            else if (tag_queue_size() > 0 AND added_filename <> "/q")
  557.            {
  558.              print("\x16\x01\x0eAltername Path, Or <ENTER> For Default (Include Trailing BackSlash)\n : ");
  559.              input_str(new_path,INPUT_WORD,0,80,"");
  560.              if (new_path <> "")
  561.                out_path := new_path;
  562.              else
  563.                out_path := DEFAULT_PATH;
  564.              qsize := (tag_queue_size());
  565.              for (fnum := 0; fnum < qsize; fnum := fnum +1)
  566.              {
  567.                tag_get_name( fnum, flags, filescheck);
  568.                pos := strridx(filescheck, 0, '\\');
  569.                if (pos=0)
  570.                  rootname := filescheck;
  571.                else
  572.                  rootname := substr(filescheck, pos+1, strlen(filescheck)-pos+1);
  573.                filecopy(filescheck,out_path+rootname);
  574.              }
  575.              input := "C;|";
  576.              menu_cmd(512,"");
  577.              ok := 1;
  578.            }
  579.            else
  580.              ok := 1;
  581.          }
  582.        }
  583.        else
  584.          menu_cmd(505,"");
  585.        ok := 1;
  586.      }
  587.      ch:=0;
  588.    }
  589.  }
  590. stop:
  591.  close(dat_handle);
  592.  close(idx_handle);
  593.  close(dmp_handle);
  594. }
  595.  
  596. int main()
  597. {
  598.  string: dpath;
  599.  char  : hotkeys;
  600.  
  601.  id.instant_video := 1;
  602.  
  603.  dpath := farea.downpath;
  604.  hotkeys := usr.hotkeys;
  605.  if (usr.hotkeys = 0)
  606.  {
  607.    menu_cmd(615,"");
  608.  }
  609.  if (usr.def_proto = PROTOCOL_NONE)
  610.  {
  611.    print("\x0c\x16\x01\x0fYou Must First Select A Transfer Protocol...");
  612.    menu_cmd(618,"");
  613.  }
  614.  if ((usr.video=1 OR usr.video=2) AND (usr.rip=FALSE) AND (strfind(usr.xkeys, KEY) = FALSE))
  615.    read_fbbs(dpath);
  616.  else
  617.  {
  618.    char: nonstop;
  619.    nonstop := 0;
  620.  
  621. //   If you call the internal FILE_TITLES command from a MECCA/*.BBS file,
  622. //   uncomment the next line and put the FULL path with double "\\"'s
  623. //   Then, comment out the menu_cmd line.
  624. //
  625. //   display_file("c:\\max\\menus\\filelist.bbs", nonstop);
  626.  
  627.    menu_cmd(502,"");
  628.  }
  629.  usr.hotkeys := hotkeys;
  630.  return 0;
  631. }
  632.  
  633.